package com.example.test_event_and_callback.impl;

import com.example.test_event_and_callback.infras.event.CallableEvent;

public class TestCallableEvent extends CallableEvent<TestEventDto> {
    public TestCallableEvent(Object source) {
        super(source);
    }

    @Override
    public void setCount() {
        count.set(3);
    }

    @Override
    public void setDto() {
        dto = new TestEventDto();
    }

    @Override
    public void setResult(String key, Object value) {
        switch (key){
            case "id" : dto.setId((String) value);
            case "name" : dto.setName((String) value);
            case "text" : dto.setText((String) value);
        }
    }
}
